home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / mpfeel.lha / MPFeel / Plurals / proc_pair.m < prev    next >
Text File  |  1992-05-29  |  2KB  |  85 lines

  1. /*
  2.  *    Paired Processors
  3.  *
  4.  *    Author:    S.C.Merrall
  5.  *
  6.  *    File:    proc_pair.m
  7.  *
  8.  *    Contents:    PP_left_right_proc
  9.  *            PP_active_set
  10.  *            PP_other_way
  11.  *
  12.  *    Description:    Three variables which specify the current state of
  13.  *            paired processor system. One indicates which direction
  14.  *            data should be transferred to move it to the `other'
  15.  *            set.
  16.  *
  17.  *    Change History:
  18.  *
  19.  *    Date   Name Comment
  20.  *    -------- ---- -------
  21.  *    17:01:92 SCM  Created
  22.  *
  23.  */
  24.  
  25. #include <mpl.h>
  26. #include "proc_pair.h"
  27.  
  28. /*  These variables are the proc pair equivalents of the mpl globals
  29.  *  without the prefix
  30.  */
  31.  
  32. int PP_nproc;
  33. plural int PP_iproc;
  34.  
  35. int PP_nxproc;
  36. plural int PP_ixproc;
  37.  
  38. int PP_nyproc;
  39. plural int PP_iyproc;
  40.  
  41. /*  These variables specify what the current processor set is and which
  42.  *  way data should move. The starting configuration is:
  43.  *
  44.  *  Even numbered PEs are active;
  45.  *                      PP_active_set = (1, 0, 1, 0, 1, 0, 1, 0 ... )
  46.  *
  47.  *  That is the left member of each pair is active;
  48.  *                      PP_left_right_proc = PP_LEFT;
  49.  *
  50.  *  The variable PP_which_way specifies which direction the `other' set is.
  51.  *  That is, is it left or right;
  52.  *                      PP_which_way = (PP_RIGHT, PP_LEFT, PP_RIGHT, PP_LEFT ..
  53.  *                                   = (1, 0, 1, 0 ...)
  54.  */
  55.  
  56. int PP_left_right_proc;
  57. plural int PP_active_set;
  58. plural int PP_which_way;
  59.  
  60. #ifdef __STDC__
  61.  
  62. void init_proc_pair( void )
  63.  
  64. #else
  65.  
  66. void init_proc_pair( )
  67.  
  68. #endif
  69.  
  70. {
  71.    PP_nproc = nproc/2;
  72.    PP_iproc = iproc/2;
  73.    PP_nxproc = nxproc/2;
  74.    PP_ixproc = ixproc/2;
  75.    PP_nyproc = nyproc;
  76.    PP_iyproc = iyproc;
  77.    PP_left_right_proc = PP_LEFT;
  78.    PP_active_set = (!(iproc%2));
  79.    PP_which_way = (PP_active_set);
  80.     
  81. /*   PP_switch();  */
  82.  
  83.  }
  84.  
  85.